/*package com.example.demo;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.DisplayMetrics;
import android.util.FloatMath;
import android.util.Log;
import android.view.Display;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;

import com.example.smart_home.R;
import com.ht.camera.FileCache;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
//import object.p2pipcam.nativecaller.NativeCaller;

public class PlayActivity extends Activity
  implements View.OnTouchListener, GestureDetector.OnGestureListener, View.OnClickListener, BridgeService.PlayInterface
{
  private static final int AUDIO_BUFFER_START_CODE = 16711935;
  private static final int DRAG = 1;
  private static final int FULLSCREEN = 0;
  private static final String LOG_TAG = "PlayActivity";
  private static final int MAGNIFY = 2;
  private static final int NONE = 0;
  private static final int STANDARD = 1;
  private static final int ZOOM = 2;
  private CustomBuffer AudioBuffer = null;
  private final int BRIGHT = 1;
  private final int CONTRAST = 2;
  private final int MINLEN = 80;
  private Handler PPPPMsgHandler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      switch (paramAnonymousMessage.what)
      {
      case 1004:
      }
    }
  };
  private AudioPlayer audioPlayer = null;
  private boolean bAudioStart = false;
  private boolean bDisplayFinished = true;
  private boolean bInitCameraParam = false;
  private boolean bManualExit = false;
  private boolean bProgress = true;
  private boolean bTimeoutStarted = false;
  float baseValue;
  private MyBrodCast brodCast = null;
  private Button button_back;
  private FileCache cache;
  private Animation dismissAnim;
  private Animation dismissTopAnim;
  private BitmapDrawable drawable = null;
  private File f;
  private GestureDetector gt = new GestureDetector(this);
  private ImageView imgDown = null;
  private ImageView imgLeft = null;
  private ImageView imgRight = null;
  private ImageView imgUp = null;
  private boolean isDown = false;
  private boolean isExit = false;
  private boolean isHorizontalMirror = false;
  private boolean isLeftRight = false;
  private boolean isMcriophone = false;
  private boolean isPTZPrompt;
  private boolean isSecondDown = false;
  private boolean isShowtoping = false;
  private boolean isTakeVideo = false;
  private boolean isTakepic = true;
  private boolean isUpDown = false;
  private boolean isUpDownPressed = false;
  private boolean isVerticalMirror = false;
  protected Matrix mBaseMatrix = new Matrix();
  private Bitmap mBmp;
  private Matrix mDisplayMatrix = new Matrix();
  private Handler mHandler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      String str = paramAnonymousMessage.getData().getString("did");
      if ((paramAnonymousMessage.what == 1) || (paramAnonymousMessage.what == 2))
        PlayActivity.this.setViewVisible();
      if (!PlayActivity.this.isPTZPrompt)
      {
        PlayActivity.access$1002(PlayActivity.this, true);
        PlayActivity.this.showToast(R.string.ptz_control);
      }
      switch (paramAnonymousMessage.what)
      {
      default:
      case 1:
      case 2:
      case 3:
      }
      while (true)
      {
        if ((paramAnonymousMessage.what == 1) || (paramAnonymousMessage.what == 2))
        {
          PlayActivity.access$1902(PlayActivity.this, true);
          PlayActivity.access$2208(PlayActivity.this);
          if (PlayActivity.this.nPlayCount >= 100)
            PlayActivity.access$2202(PlayActivity.this, 0);
        }
        return;
        byte[] arrayOfByte = new byte[2 * (PlayActivity.this.nVideoWidths * PlayActivity.this.nVideoHeights)];
        NativeCaller.YUV4202RGB565(PlayActivity.this.videodata, arrayOfByte, PlayActivity.this.nVideoWidths, PlayActivity.this.nVideoHeights);
        ByteBuffer localByteBuffer = ByteBuffer.wrap(arrayOfByte);
        PlayActivity.access$1302(PlayActivity.this, Bitmap.createBitmap(PlayActivity.this.nVideoWidths, PlayActivity.this.nVideoHeights, Bitmap.Config.RGB_565));
        PlayActivity.this.mBmp.copyPixelsFromBuffer(localByteBuffer);
        int i = PlayActivity.this.getWindowManager().getDefaultDisplay().getWidth();
        int j = PlayActivity.this.getWindowManager().getDefaultDisplay().getHeight();
        PlayActivity.this.vidoeView.setVisibility(8);
        Bitmap localBitmap;
        if (PlayActivity.this.getResources().getConfiguration().orientation == 1)
        {
          FrameLayout.LayoutParams localLayoutParams1 = new FrameLayout.LayoutParams(i, i * 3 / 4);
          localLayoutParams1.gravity = 17;
          PlayActivity.this.myGlSurfaceView.setLayoutParams(localLayoutParams1);
          localBitmap = Bitmap.createScaledBitmap(PlayActivity.this.mBmp, PlayActivity.this.nVideoWidths, PlayActivity.this.nVideoHeights, true);
        }
        while (PlayActivity.this.strDID.equals(str))
        {
          PlayActivity.this.videoViewStandard.setImageBitmap(localBitmap);
          PlayActivity.this.videoViewStandard.setVisibility(0);
          PlayActivity.this.playSurface.setBackgroundColor(-16777216);
          break;
          int k = PlayActivity.this.getResources().getConfiguration().orientation;
          localBitmap = null;
          if (k == 2)
          {
            FrameLayout.LayoutParams localLayoutParams2 = new FrameLayout.LayoutParams(i, j);
            localLayoutParams2.gravity = 17;
            PlayActivity.this.myGlSurfaceView.setLayoutParams(localLayoutParams2);
            localBitmap = Bitmap.createScaledBitmap(PlayActivity.this.mBmp, i, j, true);
          }
        }
        PlayActivity.this.myGlSurfaceView.setVisibility(8);
        PlayActivity.access$1302(PlayActivity.this, BitmapFactory.decodeByteArray(PlayActivity.this.videodata, 0, PlayActivity.this.videoDataLen));
        if (PlayActivity.this.mBmp == null)
        {
          Log.d("PlayActivity", "bmp can't be decode...");
          PlayActivity.access$1902(PlayActivity.this, true);
          return;
        }
        PlayActivity.access$2002(PlayActivity.this, PlayActivity.this.mBmp.getWidth());
        PlayActivity.access$2102(PlayActivity.this, PlayActivity.this.mBmp.getHeight());
        if (PlayActivity.this.strDID.equals(str))
          if (PlayActivity.this.getResources().getConfiguration().orientation == 1)
          {
            PlayActivity.this.videoViewStandard.setVisibility(8);
            PlayActivity.this.vidoeView.setVisibility(0);
            PlayActivity.this.vidoeView.setImageBitmap(PlayActivity.this.mBmp);
          }
          else if (PlayActivity.this.getResources().getConfiguration().orientation == 2)
          {
            PlayActivity.this.videoViewStandard.setImageBitmap(PlayActivity.this.mBmp);
            PlayActivity.this.videoViewStandard.setVisibility(0);
            PlayActivity.this.vidoeView.setVisibility(8);
            continue;
            PlayActivity.this.displayResolution();
          }
      }
    }
  };
  private final float[] mMatrixValues = new float[9];
  float mMaxZoom = 2.0F;
  float mMinZoom = 0.3125F;
  private PopupWindow mPopupWindowProgress;
  protected Matrix mSuppMatrix = new Matrix();
  private Matrix matrix = new Matrix();
  private int message;
  private PointF mid = new PointF();
  private int mode = 0;
  private Handler msgHandler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      if (paramAnonymousMessage.what == 1)
      {
        Log.d("tag", "鏂嚎浜�");
        Toast.makeText(PlayActivity.this.getApplicationContext(), R.string.pppp_status_disconnect, 0).show();
      }
    }
  };
  private Handler msgStreamCodecHandler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      if (PlayActivity.this.nStreamCodecType == 1);
    }
  };
  private GLSurfaceView myGlSurfaceView = null;
  private MyRender myRender = null;
  private int nBrightness = 0;
  private int nContrast = 0;
  private int nFlip = 0;
  private int nFramerate = 0;
  private int nMode = 0;
  private int nP2PMode = 1;
  private int nPlayCount = 0;
  private int nResolution = 0;
  private int nStreamCodecType;
  private int nSurfaceHeight = 0;
  private int nTimeoutRemain = 180;
  private int nVideoHeight = 0;
  public int nVideoHeights = 0;
  private int nVideoWidth = 0;
  public int nVideoWidths = 0;
  private float oldDist;
  float originalScale;
  private View osdView = null;
  private SurfaceHolder playHolder = null;
  private SurfaceView playSurface = null;
  private int playmode = 1;
  private Handler popuHandle = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      PlayActivity.access$3602(PlayActivity.this, paramAnonymousMessage.what);
      if (paramAnonymousMessage.what == 1)
        PlayActivity.this.setBackButton.setImageBitmap(PlayActivity.this.takepick);
      while (true)
      {
        new Thread(new Runnable()
        {
          public void run()
          {
            File localFile = new File("/sdcard/kinkony/" + PlayActivity.this.strDID + PlayActivity.this.message + ".png");
            try
            {
              localFile.createNewFile();
              try
              {
                label59: FileOutputStream localFileOutputStream1 = new FileOutputStream(localFile);
                localFileOutputStream2 = localFileOutputStream1;
                PlayActivity.this.takepick.compress(Bitmap.CompressFormat.PNG, 50, localFileOutputStream2);
              }
              catch (FileNotFoundException localIOException2)
              {
                try
                {
                  localFileOutputStream2.flush();
                }
                catch (IOException localIOException2)
                {
                  try
                  {
                    while (true)
                    {
                      localFileOutputStream2.close();
                      return;
                      localFileNotFoundException = localFileNotFoundException;
                      localFileNotFoundException.printStackTrace();
                      FileOutputStream localFileOutputStream2 = null;
                      continue;
                      localIOException2 = localIOException2;
                      localIOException2.printStackTrace();
                    }
                  }
                  catch (IOException localIOException3)
                  {
                    localIOException3.printStackTrace();
                    return;
                  }
                }
              }
            }
            catch (IOException localIOException1)
            {
              break label59;
            }
          }
        }).start();
        PlayActivity.access$2302(PlayActivity.this, true);
        return;
        if (paramAnonymousMessage.what == 2)
          PlayActivity.this.setBackButton1.setImageBitmap(PlayActivity.this.takepick);
        else if (paramAnonymousMessage.what == 3)
          PlayActivity.this.setBackButton2.setImageBitmap(PlayActivity.this.takepick);
        else if (paramAnonymousMessage.what == 4)
          PlayActivity.this.setBackButton3.setImageBitmap(PlayActivity.this.takepick);
        else if (paramAnonymousMessage.what == 5)
          PlayActivity.this.setBackButton4.setImageBitmap(PlayActivity.this.takepick);
      }
    }
  };
  private PopupWindow popupWindow_about = null;
  private PopupWindow popupWindow_more = null;
  private PopupWindow popupWindow_set = null;
  private View progressView = null;
  private ImageButton ptzCameraSet;
  private ImageButton ptzHoriMirror2;
  private ImageButton ptzHoriTour2;
  private View ptzOtherSetAnimView;
  private ImageButton ptzPlayMode;
  private ImageButton ptzResolutoin;
  private ImageButton ptzVertMirror2;
  private ImageButton ptzVertTour2;
  private PopupWindow resolutionPopWindow;
  private Matrix savedMatrix = new Matrix();
  private ImageView setBackButton;
  private ImageView setBackButton1;
  private ImageView setBackButton2;
  private ImageView setBackButton3;
  private ImageView setBackButton4;
  private Animation showAnim;
  private Animation showTopAnim;
  private PointF start = new PointF();
  private String strDID = null;
  private String strName = null;
  private int streamType = 3;
  private Bitmap takepick = null;
  private TextView textTimeoutTextView = null;
  private TextView textosd = null;
  private int timeOne = 0;
  private int timeTag = 0;
  private int timeTwo = 0;
  private Handler timeoutHandle = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      if (PlayActivity.this.nTimeoutRemain > 0)
      {
        PlayActivity.access$502(PlayActivity.this, -1 + PlayActivity.this.nTimeoutRemain);
        PlayActivity.this.updateTimeout();
        Message localMessage = new Message();
        PlayActivity.this.timeoutHandle.sendMessageDelayed(localMessage, 1000L);
        return;
      }
      if (!PlayActivity.this.isExit)
        Toast.makeText(PlayActivity.this.getApplicationContext(), R.string.p2p_view_time_out, 0).show();
      PlayActivity.this.finish();
    }
  };
  private LinearLayout topbg;
  private ImageButton vediomore;
  private surfaceCallback videoCallback = new surfaceCallback(null);
  private int videoDataLen = 0;
  private ImageView videoViewStandard;
  private byte[] videodata = null;
  private ImageView vidoeView;
  private float x1 = 0.0F;
  private float x2 = 0.0F;
  private float y1 = 0.0F;
  private float y2 = 0.0F;

  private void InitParams()
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    this.nSurfaceHeight = localDisplayMetrics.heightPixels;
    this.textosd.setText(this.strName);
  }

  private void StartAudio()
  {
    try
    {
      this.AudioBuffer.ClearAll();
      this.audioPlayer.AudioPlayStart();
      NativeCaller.PPPPStartAudio(this.strDID);
      return;
    }
    finally
    {
    }
  }

  private void StopAudio()
  {
    try
    {
      this.audioPlayer.AudioPlayStop();
      this.AudioBuffer.ClearAll();
      NativeCaller.PPPPStopAudio(this.strDID);
      return;
    }
    finally
    {
    }
  }

  private void defaultVideoParams()
  {
    this.nBrightness = 1;
    this.nContrast = 128;
    NativeCaller.PPPPCameraControl(this.strDID, 1, 0);
    NativeCaller.PPPPCameraControl(this.strDID, 2, 128);
    showToast(R.string.ptz_default_vedio_params);
  }

  private void dismissBrightAndContrastProgress()
  {
    if ((this.mPopupWindowProgress != null) && (this.mPopupWindowProgress.isShowing()))
    {
      this.mPopupWindowProgress.dismiss();
      this.mPopupWindowProgress = null;
    }
  }

  private void findView()
  {
    this.playSurface = ((SurfaceView)findViewById(R.id.playSurface));
    this.playSurface.setBackgroundColor(-16777216);
    this.button_back = ((Button)findViewById(R.id.login_top_back));
    this.myGlSurfaceView = ((GLSurfaceView)findViewById(R.id.myhsurfaceview));
    this.myRender = new MyRender(this.myGlSurfaceView);
    this.myGlSurfaceView.setRenderer(this.myRender);
    this.imgUp = ((ImageView)findViewById(R.id.imgup));
    this.imgDown = ((ImageView)findViewById(R.id.imgdown));
    this.imgRight = ((ImageView)findViewById(R.id.imgright));
    this.imgLeft = ((ImageView)findViewById(R.id.imgleft));
    this.vediomore = ((ImageButton)findViewById(R.id.vedio_more));
    this.ptzCameraSet = ((ImageButton)findViewById(R.id.vedio_set));
    this.imgUp.setOnClickListener(this);
    this.imgDown.setOnClickListener(this);
    this.imgLeft.setOnClickListener(this);
    this.imgRight.setOnClickListener(this);
    this.vediomore.setOnClickListener(this);
    this.button_back.setOnClickListener(this);
    this.ptzCameraSet.setOnClickListener(this);
    this.vidoeView = ((ImageView)findViewById(R.id.vedioview));
    this.videoViewStandard = ((ImageView)findViewById(R.id.vedioview_standard));
    this.progressView = findViewById(R.id.progressLayout);
    this.textosd = ((TextView)findViewById(R.id.textosd));
    this.textTimeoutTextView = ((TextView)findViewById(R.id.textTimeout));
    this.osdView = findViewById(R.id.osdlayout);
    this.ptzHoriTour2 = ((ImageButton)findViewById(R.id.ptz_hori_tour));
    this.ptzVertTour2 = ((ImageButton)findViewById(R.id.ptz_vert_tour));
    this.ptzResolutoin = ((ImageButton)findViewById(R.id.ptz_resoluti));
    this.ptzOtherSetAnimView = findViewById(R.id.ptz_othersetview_anim);
    this.ptzHoriTour2.setOnClickListener(this);
    this.ptzVertTour2.setOnClickListener(this);
    this.ptzResolutoin.setOnClickListener(this);
    this.topbg = ((LinearLayout)findViewById(R.id.linearLayout2));
    this.ptzOtherSetAnimView.setBackgroundDrawable(this.drawable);
  }

  private void getCameraParams()
  {
    NativeCaller.PPPPGetSystemParams(this.strDID, 2);
  }

  private void midPoint(PointF paramPointF, MotionEvent paramMotionEvent)
  {
    float f1 = paramMotionEvent.getX(0) + paramMotionEvent.getX(1);
    float f2 = paramMotionEvent.getY(0) + paramMotionEvent.getY(1);
    paramPointF.set(f1 / 2.0F, f2 / 2.0F);
  }

  private void setBrightOrContrast(final int paramInt)
  {
    Log.i("PlayActivity", "type:" + paramInt + "  bInitCameraParam:" + this.bInitCameraParam);
    if (!this.bInitCameraParam)
      return;
    int i = getWindowManager().getDefaultDisplay().getWidth();
    LinearLayout localLinearLayout = (LinearLayout)LayoutInflater.from(this).inflate(R.layout.brightprogress, null);
    SeekBar localSeekBar = (SeekBar)localLinearLayout.findViewById(R.id.brightseekBar1);
    localSeekBar.setMax(255);
    switch (paramInt)
    {
    default:
    case 1:
    case 2:
    }
    while (true)
    {
      localSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
      {
        public void onProgressChanged(SeekBar paramAnonymousSeekBar, int paramAnonymousInt, boolean paramAnonymousBoolean)
        {
        }

        public void onStartTrackingTouch(SeekBar paramAnonymousSeekBar)
        {
        }

        public void onStopTrackingTouch(SeekBar paramAnonymousSeekBar)
        {
          int i = paramAnonymousSeekBar.getProgress();
          switch (paramInt)
          {
          default:
            return;
          case 1:
            PlayActivity.access$3402(PlayActivity.this, i);
            NativeCaller.PPPPCameraControl(PlayActivity.this.strDID, 1, PlayActivity.this.nBrightness);
            return;
          case 2:
          }
          PlayActivity.access$3502(PlayActivity.this, i);
          NativeCaller.PPPPCameraControl(PlayActivity.this.strDID, 2, PlayActivity.this.nContrast);
        }
      });
      this.mPopupWindowProgress = new PopupWindow(localLinearLayout, i / 2, 180);
      this.mPopupWindowProgress.showAtLocation(findViewById(R.id.play), 48, 0, 0);
      return;
      localSeekBar.setProgress(this.nBrightness);
      continue;
      localSeekBar.setProgress(this.nContrast);
    }
  }

  private void setViewVisible()
  {
    if (this.bProgress)
    {
      this.bProgress = false;
      this.progressView.setVisibility(4);
      this.osdView.setVisibility(0);
      if (this.nP2PMode == 2)
      {
        updateTimeout();
        this.textTimeoutTextView.setVisibility(0);
        startTimeout();
      }
      getCameraParams();
    }
  }

  private void showBottom()
  {
    if (this.isUpDownPressed)
    {
      this.isUpDownPressed = false;
      this.ptzOtherSetAnimView.startAnimation(this.dismissAnim);
      this.ptzOtherSetAnimView.setVisibility(8);
      return;
    }
    this.isUpDownPressed = true;
    this.ptzOtherSetAnimView.startAnimation(this.showAnim);
    this.ptzOtherSetAnimView.setVisibility(0);
  }

  private void showToast(int paramInt)
  {
    Toast.makeText(this, paramInt, 0).show();
  }

  private void showTop()
  {
    if (this.isShowtoping)
    {
      this.isShowtoping = false;
      this.topbg.setVisibility(8);
      this.topbg.startAnimation(this.dismissTopAnim);
      return;
    }
    this.isShowtoping = true;
    this.topbg.setVisibility(0);
    this.topbg.startAnimation(this.showTopAnim);
  }

  private float spacing(MotionEvent paramMotionEvent)
  {
    try
    {
      float f1 = paramMotionEvent.getX(0) - paramMotionEvent.getX(1);
      float f2 = paramMotionEvent.getY(0) - paramMotionEvent.getY(1);
      float f3 = FloatMath.sqrt(f1 * f1 + f2 * f2);
      return f3;
    }
    catch (Exception localException)
    {
    }
    return 0.0F;
  }

  private void startTimeout()
  {
    if (!this.bTimeoutStarted)
    {
      Message localMessage = new Message();
      this.timeoutHandle.sendMessageDelayed(localMessage, 1000L);
      this.bTimeoutStarted = true;
    }
  }

  private void takePicture(Bitmap paramBitmap)
  {
    this.takepick = paramBitmap;
  }

  private void updateTimeout()
  {
    this.textTimeoutTextView.setText(getString(R.string.p2p_relay_mode_time_out) + this.nTimeoutRemain + getString(R.string.str_second));
  }

  public void callBaceVideoData(String paramString, byte[] paramArrayOfByte, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (!this.bDisplayFinished)
    {
      Log.d("info", "return bDisplayFinished");
      return;
    }
    this.bDisplayFinished = false;
    this.videodata = paramArrayOfByte;
    this.videoDataLen = paramInt2;
    this.nVideoWidths = paramInt3;
    this.nVideoHeights = paramInt4;
    Bundle localBundle = new Bundle();
    localBundle.putString("did", paramString);
    Message localMessage = new Message();
    localMessage.setData(localBundle);
    if (paramInt1 == 1)
    {
      Log.i("info", "h264Data....");
      if (this.isTakepic)
      {
        this.isTakepic = false;
        byte[] arrayOfByte = new byte[2 * (paramInt3 * paramInt4)];
        NativeCaller.YUV4202RGB565(paramArrayOfByte, arrayOfByte, paramInt3, paramInt4);
        ByteBuffer localByteBuffer = ByteBuffer.wrap(arrayOfByte);
        this.mBmp = Bitmap.createBitmap(paramInt3, paramInt4, Bitmap.Config.RGB_565);
        this.mBmp.copyPixelsFromBuffer(localByteBuffer);
        takePicture(this.mBmp);
      }
    }
    for (localMessage.what = 1; ; localMessage.what = 2)
    {
      this.mHandler.sendMessage(localMessage);
      return;
      Log.i("info", "MJPEG....");
      if (this.isTakepic)
      {
        this.mBmp = BitmapFactory.decodeByteArray(this.videodata, 0, this.videoDataLen);
        takePicture(this.mBmp);
      }
    }
  }

  public void callBackAudioData(byte[] paramArrayOfByte, int paramInt)
  {
    Log.d("PlayActivity", "AudioData: len :+ " + paramInt);
    if (!this.audioPlayer.isAudioPlaying())
      return;
    CustomBufferHead localCustomBufferHead = new CustomBufferHead();
    CustomBufferData localCustomBufferData = new CustomBufferData();
    localCustomBufferHead.length = paramInt;
    localCustomBufferHead.startcode = 16711935;
    localCustomBufferData.head = localCustomBufferHead;
    localCustomBufferData.data = paramArrayOfByte;
    this.AudioBuffer.addData(localCustomBufferData);
  }

  public void callBackCameraParamNotify(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6)
  {
    Log.d("info", "CameraParamNotify...did:" + paramString + " brightness: " + paramInt2 + " resolution: " + paramInt1 + " contrast: " + paramInt3 + " hue: " + paramInt4 + " saturation: " + paramInt5 + " flip: " + paramInt6);
    Log.d("tag", "contrast:" + paramInt3 + " brightness:" + paramInt2);
    this.nBrightness = paramInt2;
    this.nContrast = paramInt3;
    this.nResolution = paramInt1;
    Log.d("VGA", this.nResolution + "");
    Message localMessage = new Message();
    localMessage.what = 3;
    this.mHandler.sendMessage(localMessage);
    this.bInitCameraParam = true;
  }

  public void callBackH264Data(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    Log.d("tag", "CallBack_H264Data type:" + paramInt1 + " size:" + paramInt2);
  }

  public void callBackMessageNotify(String paramString, int paramInt1, int paramInt2)
  {
    Log.d("tag", "MessageNotify did: " + paramString + " msgType: " + paramInt1 + " param: " + paramInt2);
    if (this.bManualExit);
    do
    {
      return;
      if (paramInt1 == 2)
      {
        this.nStreamCodecType = paramInt2;
        Message localMessage2 = new Message();
        this.msgStreamCodecHandler.sendMessage(localMessage2);
        return;
      }
    }
    while ((paramInt1 != 0) || (!paramString.equals(this.strDID)));
    Message localMessage1 = new Message();
    localMessage1.what = 1;
    this.msgHandler.sendMessage(localMessage1);
  }

  protected void displayResolution()
  {
    switch (this.nResolution)
    {
    default:
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    }
  }

  protected Matrix getImageViewMatrix()
  {
    this.mDisplayMatrix.set(this.mBaseMatrix);
    this.mDisplayMatrix.postConcat(this.mSuppMatrix);
    return this.mDisplayMatrix;
  }

  protected float getScale()
  {
    return getScale(this.mSuppMatrix);
  }

  protected float getScale(Matrix paramMatrix)
  {
    return getValue(paramMatrix, 0);
  }

  protected float getValue(Matrix paramMatrix, int paramInt)
  {
    paramMatrix.getValues(this.mMatrixValues);
    return this.mMatrixValues[paramInt];
  }

  @SuppressLint({"CutPasteId"})
  public void initCameraSetWindow()
  {
    View localView = LayoutInflater.from(this).inflate(R.layout.popup_cameraset, null);
    this.popupWindow_set = new PopupWindow(localView, -2, -2);
    this.popupWindow_set.setAnimationStyle(R.style.AnimationPreview);
    this.popupWindow_set.setFocusable(true);
    this.popupWindow_set.setOutsideTouchable(true);
    this.popupWindow_set.setBackgroundDrawable(new ColorDrawable(0));
    Button localButton1 = (Button)localView.findViewById(R.id.set_btn1);
    this.setBackButton = ((ImageView)localView.findViewById(R.id.setback_btn1));
    Button localButton2 = (Button)localView.findViewById(R.id.set_btn2);
    this.setBackButton1 = ((ImageView)localView.findViewById(R.id.setback_btn2));
    Button localButton3 = (Button)localView.findViewById(R.id.set_btn3);
    this.setBackButton2 = ((ImageView)localView.findViewById(R.id.setback_btn3));
    Button localButton4 = (Button)localView.findViewById(R.id.set_btn4);
    this.setBackButton3 = ((ImageView)localView.findViewById(R.id.setback_btn4));
    Button localButton5 = (Button)localView.findViewById(R.id.set_btn5);
    this.setBackButton4 = ((ImageView)localView.findViewById(R.id.setback_btn5));
    loadImageList();
    localButton1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 30);
        PlayActivity.access$2302(PlayActivity.this, false);
        Message localMessage = PlayActivity.this.popuHandle.obtainMessage(1);
        PlayActivity.this.popuHandle.sendMessage(localMessage);
      }
    });
    this.setBackButton.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 31);
      }
    });
    localButton2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 32);
        PlayActivity.access$2302(PlayActivity.this, false);
        Message localMessage = PlayActivity.this.popuHandle.obtainMessage(2);
        PlayActivity.this.popuHandle.sendMessage(localMessage);
      }
    });
    this.setBackButton1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 33);
      }
    });
    localButton3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 34);
        PlayActivity.access$2302(PlayActivity.this, false);
        Message localMessage = PlayActivity.this.popuHandle.obtainMessage(3);
        PlayActivity.this.popuHandle.sendMessage(localMessage);
      }
    });
    this.setBackButton2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 35);
      }
    });
    localButton4.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 36);
        PlayActivity.access$2302(PlayActivity.this, false);
        Message localMessage = PlayActivity.this.popuHandle.obtainMessage(4);
        PlayActivity.this.popuHandle.sendMessage(localMessage);
      }
    });
    this.setBackButton3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 37);
      }
    });
    localButton5.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 38);
        PlayActivity.access$2302(PlayActivity.this, false);
        Message localMessage = PlayActivity.this.popuHandle.obtainMessage(5);
        PlayActivity.this.popuHandle.sendMessage(localMessage);
      }
    });
    this.setBackButton4.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPPTZControl(PlayActivity.this.strDID, 39);
      }
    });
  }

  public void initExitPopupWindow2()
  {
    View localView = LayoutInflater.from(this).inflate(R.layout.popup_d, null);
    Button localButton1 = (Button)localView.findViewById(R.id.add_check_load);
    Button localButton2 = (Button)localView.findViewById(R.id.add_check_phone);
    this.popupWindow_about = new PopupWindow(localView, -2, -2);
    this.popupWindow_about.setAnimationStyle(R.style.AnimationPreview);
    this.popupWindow_about.setFocusable(true);
    this.popupWindow_about.setOutsideTouchable(true);
    this.popupWindow_about.setBackgroundDrawable(new ColorDrawable(0));
    localButton1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPCameraControl(SystemValue.deviceId, 36, 36);
        PlayActivity.this.popupWindow_about.dismiss();
        Log.d("VGA", "VGA");
      }
    });
    localButton2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NativeCaller.PPPPCameraControl(SystemValue.deviceId, 37, 37);
        PlayActivity.this.popupWindow_about.dismiss();
        Log.d("VGA", "QVGA");
      }
    });
    this.popupWindow_about.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
        PlayActivity.this.popupWindow_about.dismiss();
      }
    });
    this.popupWindow_about.setTouchInterceptor(new View.OnTouchListener()
    {
      public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
      {
        if (paramAnonymousMotionEvent.getAction() == 4)
          PlayActivity.this.popupWindow_about.dismiss();
        return false;
      }
    });
  }

  public void initMorePopupWindow()
  {
    View localView = LayoutInflater.from(this).inflate(R.layout.popup_more, null);
    ((ImageButton)localView.findViewById(R.id.ptz_playmode));
    ImageButton localImageButton1 = (ImageButton)localView.findViewById(R.id.ptz_brightness);
    ImageButton localImageButton2 = (ImageButton)localView.findViewById(R.id.ptz_hori_mirror);
    ImageButton localImageButton3 = (ImageButton)localView.findViewById(R.id.ptz_contrast);
    ImageButton localImageButton4 = (ImageButton)localView.findViewById(R.id.ptz_default_set);
    ImageButton localImageButton5 = (ImageButton)localView.findViewById(R.id.ptz_vert_mirror);
    this.popupWindow_more = new PopupWindow(localView, -2, -2);
    this.popupWindow_more.setAnimationStyle(R.style.AnimationPreview);
    this.popupWindow_more.setFocusable(true);
    this.popupWindow_more.setOutsideTouchable(true);
    this.popupWindow_more.setBackgroundDrawable(new ColorDrawable(0));
    localImageButton1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if ((PlayActivity.this.mPopupWindowProgress != null) && (PlayActivity.this.mPopupWindowProgress.isShowing()))
        {
          PlayActivity.this.mPopupWindowProgress.dismiss();
          PlayActivity.access$2502(PlayActivity.this, null);
        }
        PlayActivity.this.setBrightOrContrast(1);
        PlayActivity.this.popupWindow_more.dismiss();
      }
    });
    localImageButton4.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        PlayActivity.this.dismissBrightAndContrastProgress();
        PlayActivity.this.defaultVideoParams();
        PlayActivity.this.popupWindow_more.dismiss();
      }
    });
    localImageButton2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (PlayActivity.this.isHorizontalMirror)
        {
          PlayActivity.access$3002(PlayActivity.this, false);
          NativeCaller.PPPPCameraControl(PlayActivity.this.strDID, 5, 0);
          Log.d("tag", "姘村钩闀滃儚杩樺師锛�0");
        }
        while (true)
        {
          PlayActivity.this.popupWindow_more.dismiss();
          return;
          PlayActivity.access$3002(PlayActivity.this, true);
          NativeCaller.PPPPCameraControl(PlayActivity.this.strDID, 5, 2);
          Log.d("tag", "姘村钩闀滃儚锛�2");
        }
      }
    });
    localImageButton5.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (PlayActivity.this.isVerticalMirror)
        {
          PlayActivity.access$3102(PlayActivity.this, false);
          NativeCaller.PPPPCameraControl(PlayActivity.this.strDID, 5, 0);
          Log.d("tag", "鍨傜洿闀滃儚杩樺師锛�0");
        }
        while (true)
        {
          PlayActivity.this.popupWindow_more.dismiss();
          return;
          PlayActivity.access$3102(PlayActivity.this, true);
          NativeCaller.PPPPCameraControl(PlayActivity.this.strDID, 5, 1);
          Log.d("tag", "鍨傜洿闀滃儚锛�1");
        }
      }
    });
    localImageButton3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if ((PlayActivity.this.mPopupWindowProgress != null) && (PlayActivity.this.mPopupWindowProgress.isShowing()))
        {
          PlayActivity.this.mPopupWindowProgress.dismiss();
          PlayActivity.access$2502(PlayActivity.this, null);
        }
        PlayActivity.this.setBrightOrContrast(2);
      }
    });
  }

  public void loadImageList()
  {
    String[] arrayOfString = FileCache.getImageNames("/sdcard/kinkony/");
    for (int i = 0; i < arrayOfString.length; i++)
    {
      if (arrayOfString[i].equals(this.strDID + 1 + ".png"))
        this.setBackButton.setImageURI(Uri.parse("/sdcard/kinkony/" + arrayOfString[i]));
      if (arrayOfString[i].equals(this.strDID + 2 + ".png"))
        this.setBackButton1.setImageURI(Uri.parse("/sdcard/kinkony/" + arrayOfString[i]));
      if (arrayOfString[i].equals(this.strDID + 3 + ".png"))
        this.setBackButton2.setImageURI(Uri.parse("/sdcard/kinkony/" + arrayOfString[i]));
      if (arrayOfString[i].equals(this.strDID + 4 + ".png"))
        this.setBackButton3.setImageURI(Uri.parse("/sdcard/kinkony/" + arrayOfString[i]));
      if (arrayOfString[i].equals(this.strDID + 5 + ".png"))
        this.setBackButton4.setImageURI(Uri.parse("/sdcard/kinkony/" + arrayOfString[i]));
    }
  }

  @SuppressLint({"ResourceAsColor"})
  public void onClick(View paramView)
  {
    int i = paramView.getId();
    if (i == R.id.login_top_back)
      showSureDialogPlay();
    do
    {
      return;
      if (i == R.id.vedio_more)
      {
        this.popupWindow_more.showAtLocation(this.button_back, 17, 0, 0);
        return;
      }
      if (i == R.id.vedio_set)
      {
        this.popupWindow_set.showAtLocation(this.button_back, 17, 0, 0);
        return;
      }
      if (i == R.id.imgup)
      {
        NativeCaller.PPPPPTZControl(this.strDID, 0);
        Log.d("tag", "up");
        return;
      }
      if (i == R.id.imgdown)
      {
        NativeCaller.PPPPPTZControl(this.strDID, 2);
        Log.d("tag", "down");
        return;
      }
      if (i == R.id.imgleft)
      {
        NativeCaller.PPPPPTZControl(this.strDID, 4);
        Log.d("tag", "left");
        return;
      }
      if (i == R.id.imgright)
      {
        NativeCaller.PPPPPTZControl(this.strDID, 6);
        Log.d("tag", "right");
        return;
      }
      if (i == R.id.ptz_hori_mirror)
      {
        if (this.isHorizontalMirror)
        {
          this.ptzHoriMirror2.setBackgroundColor(16777215);
          this.isHorizontalMirror = false;
          NativeCaller.PPPPCameraControl(this.strDID, 5, 0);
          Log.d("tag", "姘村钩闀滃儚杩樺師锛�0");
          return;
        }
        this.isHorizontalMirror = true;
        this.ptzHoriMirror2.setBackgroundColor(-16759638);
        NativeCaller.PPPPCameraControl(this.strDID, 5, 2);
        Log.d("tag", "姘村钩闀滃儚锛�2");
        return;
      }
      if (i == R.id.ptz_vert_mirror)
      {
        if (this.isVerticalMirror)
        {
          this.isVerticalMirror = false;
          this.ptzVertMirror2.setBackgroundColor(16777215);
          NativeCaller.PPPPCameraControl(this.strDID, 5, 0);
          Log.d("tag", "鍨傜洿闀滃儚杩樺師锛�0");
          return;
        }
        this.isVerticalMirror = true;
        this.ptzVertMirror2.setBackgroundColor(-16759638);
        NativeCaller.PPPPCameraControl(this.strDID, 5, 1);
        Log.d("tag", "鍨傜洿闀滃儚锛�1");
        return;
      }
      if (i == R.id.ptz_hori_tour)
      {
        if (this.isLeftRight)
        {
          this.isLeftRight = false;
          NativeCaller.PPPPPTZControl(this.strDID, 29);
          this.ptzHoriTour2.setImageResource(R.drawable.ptz_ico3);
          Log.d("tag", "姘村钩宸¤鍋滄:29");
          return;
        }
        this.isLeftRight = true;
        NativeCaller.PPPPPTZControl(this.strDID, 28);
        Log.d("tag", "姘村钩宸¤寮�濮�:28");
        this.ptzHoriTour2.setImageResource(R.drawable.ico3on);
        return;
      }
      if (i == R.id.ptz_vert_tour)
      {
        if (this.isUpDown)
        {
          this.isUpDown = false;
          NativeCaller.PPPPPTZControl(this.strDID, 27);
          Log.d("tag", "鍨傜洿宸¤鍋滄:27");
          return;
        }
        this.isUpDown = true;
        NativeCaller.PPPPPTZControl(this.strDID, 26);
        Log.d("tag", "鍨傜洿宸¤寮�濮�:26");
        return;
      }
      if (i == R.id.ptz_brightness)
      {
        if ((this.mPopupWindowProgress != null) && (this.mPopupWindowProgress.isShowing()))
        {
          this.mPopupWindowProgress.dismiss();
          this.mPopupWindowProgress = null;
        }
        setBrightOrContrast(1);
        return;
      }
      if (i == R.id.ptz_contrast)
      {
        if ((this.mPopupWindowProgress != null) && (this.mPopupWindowProgress.isShowing()))
        {
          this.mPopupWindowProgress.dismiss();
          this.mPopupWindowProgress = null;
        }
        setBrightOrContrast(2);
        return;
      }
      if (i == R.id.ptz_resoluti)
      {
        this.popupWindow_about.showAtLocation(this.button_back, 17, 0, 0);
        return;
      }
      if (i == R.id.ptz_resolution_jpeg_qvga)
      {
        dismissBrightAndContrastProgress();
        this.resolutionPopWindow.dismiss();
        this.nResolution = 1;
        setResolution(this.nResolution);
        Log.d("tag", "jpeg resolution:" + this.nResolution + " qvga");
        return;
      }
      if (i == R.id.ptz_resolution_jpeg_vga)
      {
        dismissBrightAndContrastProgress();
        this.resolutionPopWindow.dismiss();
        this.nResolution = 0;
        setResolution(this.nResolution);
        Log.d("tag", "jpeg resolution:" + this.nResolution + " vga");
        return;
      }
      if (i == R.id.ptz_resolution_h264_qvga)
      {
        dismissBrightAndContrastProgress();
        this.resolutionPopWindow.dismiss();
        this.nResolution = 1;
        setResolution(this.nResolution);
        Log.d("tag", "h264 resolution:" + this.nResolution + " qvga");
        return;
      }
      if (i == R.id.ptz_resolution_h264_vga)
      {
        dismissBrightAndContrastProgress();
        this.resolutionPopWindow.dismiss();
        this.nResolution = 0;
        setResolution(this.nResolution);
        Log.d("tag", "h264 resolution:" + this.nResolution + " vga");
        return;
      }
      if (i == R.id.ptz_resolution_h264_720p)
      {
        dismissBrightAndContrastProgress();
        this.resolutionPopWindow.dismiss();
        this.nResolution = 3;
        setResolution(this.nResolution);
        Log.d("tag", "h264 resolution:" + this.nResolution + " 720p");
        return;
      }
      if (i == R.id.ptz_playmode)
      {
        dismissBrightAndContrastProgress();
        switch (this.playmode)
        {
        default:
          return;
        case 0:
          this.ptzPlayMode.setImageResource(R.drawable.ptz_playmode_enlarge);
          this.ptzPlayMode.setBackgroundResource(R.drawable.ptz_takepic_selector);
          Log.d("tg", "magnify 1");
          this.playmode = 1;
          return;
        case 2:
          Log.d("tg", "STANDARD 2");
          this.playmode = 0;
          this.ptzPlayMode.setImageResource(R.drawable.ptz_playmode_standard);
          this.ptzPlayMode.setBackgroundResource(R.drawable.ptz_takepic_selector);
          return;
        case 1:
        }
        Log.d("tg", "FULLSCREEN 3");
        this.playmode = 2;
        this.ptzPlayMode.setImageResource(R.drawable.ptz_playmode_fullscreen);
        this.ptzPlayMode.setBackgroundResource(R.drawable.ptz_takepic_selector);
        return;
      }
    }
    while (i != R.id.ptz_default_set);
    dismissBrightAndContrastProgress();
    defaultVideoParams();
  }

  public void onConfigurationChanged(Configuration paramConfiguration)
  {
    super.onConfigurationChanged(paramConfiguration);
    this.mBaseMatrix = new Matrix();
    this.mSuppMatrix = new Matrix();
    this.mDisplayMatrix = new Matrix();
    this.videoViewStandard.setImageMatrix(this.mDisplayMatrix);
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    getWindow().setFlags(1024, 1024);
    requestWindowFeature(1);
    setContentView(R.layout.play);
    this.strName = SystemValue.deviceName;
    this.strDID = SystemValue.deviceId;
    findView();
    InitParams();
    this.AudioBuffer = new CustomBuffer();
    this.audioPlayer = new AudioPlayer(this.AudioBuffer);
    BridgeService.setPlayInterface(this);
    this.playHolder = this.playSurface.getHolder();
    this.playHolder.setFormat(4);
    this.playHolder.addCallback(this.videoCallback);
    this.playSurface.setOnTouchListener(this);
    this.playSurface.setLongClickable(true);
    getCameraParams();
    this.dismissTopAnim = AnimationUtils.loadAnimation(this, R.anim.ptz_top_anim_dismiss);
    this.showTopAnim = AnimationUtils.loadAnimation(this, R.anim.ptz_top_anim_show);
    this.showAnim = AnimationUtils.loadAnimation(this, R.anim.ptz_otherset_anim_show);
    this.dismissAnim = AnimationUtils.loadAnimation(this, R.anim.ptz_otherset_anim_dismiss);
    SharedPreferences localSharedPreferences = getSharedPreferences("ptzcontrol", 0);
    this.isPTZPrompt = localSharedPreferences.getBoolean("ptzcontrol", false);
    if (!this.isPTZPrompt)
    {
      SharedPreferences.Editor localEditor = localSharedPreferences.edit();
      localEditor.putBoolean("ptzcontrol", true);
      localEditor.commit();
    }
    initMorePopupWindow();
    initExitPopupWindow2();
    initCameraSetWindow();
    this.brodCast = new MyBrodCast();
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction("drop");
    registerReceiver(this.brodCast, localIntentFilter);
    showTop();
  }

  protected void onDestroy()
  {
    NativeCaller.StopPPPPLivestream(this.strDID);
    StopAudio();
    if (this.myRender != null)
      this.myRender.destroyShaders();
    if (this.brodCast != null)
      unregisterReceiver(this.brodCast);
    Log.d("tag", "PlayActivity onDestroy");
    this.popupWindow_set.dismiss();
    super.onDestroy();
  }

  public boolean onDown(MotionEvent paramMotionEvent)
  {
    Log.d("tag", "onDown");
    return false;
  }

  public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    float f1 = paramMotionEvent1.getX();
    float f2 = paramMotionEvent2.getX();
    float f3 = paramMotionEvent1.getY();
    float f4 = paramMotionEvent2.getY();
    float f5;
    float f6;
    if (f1 > f2)
    {
      f5 = f1 - f2;
      if (f3 <= f4)
        break label101;
      f6 = f3 - f4;
      label54: if (f5 <= f6)
        break label139;
      if ((f1 <= f2) || (f5 <= 80.0F))
        break label111;
      NativeCaller.PPPPPTZControl(this.strDID, 6);
    }
    label101: label111: 
    do
    {
      do
      {
        return false;
        f5 = f2 - f1;
        break;
        f6 = f4 - f3;
        break label54;
      }
      while ((f1 >= f2) || (f5 <= 80.0F));
      NativeCaller.PPPPPTZControl(this.strDID, 4);
      return false;
      if ((f3 > f4) && (f6 > 80.0F))
      {
        NativeCaller.PPPPPTZControl(this.strDID, 2);
        return false;
      }
    }
    while ((f3 >= f4) || (f6 <= 80.0F));
    label139: NativeCaller.PPPPPTZControl(this.strDID, 0);
    return false;
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public void onLongPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    return false;
  }

  public void onShowPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onSingleTapUp(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    if (!this.isDown)
    {
      this.x1 = paramMotionEvent.getX();
      this.y1 = paramMotionEvent.getY();
      this.isDown = true;
    }
    switch (0xFF & paramMotionEvent.getAction())
    {
    case 3:
    case 4:
    case 6:
    default:
    case 0:
    case 1:
    case 5:
    case 2:
    }
    while (true)
    {
      if ((this.mPopupWindowProgress != null) && (this.mPopupWindowProgress.isShowing()))
        this.mPopupWindowProgress.dismiss();
      return this.gt.onTouchEvent(paramMotionEvent);
      this.savedMatrix.set(this.matrix);
      this.start.set(paramMotionEvent.getX(), paramMotionEvent.getY());
      this.mode = 1;
      this.originalScale = getScale();
      continue;
      if ((Math.abs(this.x1 - this.x2) < 25.0F) && (Math.abs(this.y1 - this.y2) < 25.0F))
      {
        if ((this.resolutionPopWindow != null) && (this.resolutionPopWindow.isShowing()))
          this.resolutionPopWindow.dismiss();
        if ((this.mPopupWindowProgress != null) && (this.mPopupWindowProgress.isShowing()))
          this.mPopupWindowProgress.dismiss();
        if ((!this.isSecondDown) && (!this.bProgress))
        {
          showTop();
          showBottom();
        }
        this.isSecondDown = false;
      }
      this.x1 = 0.0F;
      this.x2 = 0.0F;
      this.y1 = 0.0F;
      this.y2 = 0.0F;
      this.isDown = false;
      continue;
      this.isSecondDown = true;
      this.oldDist = spacing(paramMotionEvent);
      if (this.oldDist > 10.0F)
      {
        this.savedMatrix.set(this.matrix);
        midPoint(this.mid, paramMotionEvent);
        this.mode = 2;
        continue;
        this.x2 = paramMotionEvent.getX();
        this.y2 = paramMotionEvent.getY();
        (getWindowManager().getDefaultDisplay().getWidth() / 2);
        (getWindowManager().getDefaultDisplay().getHeight() / 2);
        if (this.mode == 2)
        {
          float f1 = spacing(paramMotionEvent);
          if (f1 > 0.0F)
          {
            float f2 = f1 / this.oldDist;
            Log.d("scale", "scale:" + f2);
            if ((f2 > 2.0F) || (f2 < 0.2F));
          }
        }
      }
    }
  }

  protected void setResolution(int paramInt)
  {
    Log.d("tag", "setResolution resolution:" + paramInt);
    NativeCaller.PPPPCameraControl(this.strDID, 0, paramInt);
  }

  public void showSureDialog1()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setIcon(R.drawable.app);
    localBuilder.setTitle(getResources().getString(R.string.exit) + getResources().getString(R.string.app_name));
    localBuilder.setMessage(R.string.exit_alert);
    localBuilder.setPositiveButton(R.string.str_ok, new DialogInterface.OnClickListener()
    {
      public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
      {
        Intent localIntent = new Intent("finish");
        PlayActivity.this.sendBroadcast(localIntent);
        PlayActivity.this.finish();
      }
    });
    localBuilder.setNegativeButton(R.string.str_cancel, null);
    localBuilder.show();
  }

  public void showSureDialogPlay()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setIcon(R.drawable.app);
    localBuilder.setTitle(getResources().getString(R.string.exit_show));
    localBuilder.setMessage(R.string.exit_play_show);
    localBuilder.setPositiveButton(R.string.str_ok, new DialogInterface.OnClickListener()
    {
      public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
      {
        PlayActivity.this.finish();
      }
    });
    localBuilder.setNegativeButton(R.string.str_cancel, null);
    localBuilder.show();
  }

  protected void zoomTo(float paramFloat1, float paramFloat2, float paramFloat3)
  {
    Log.d("zoomTo", "zoomTo scale:" + paramFloat1);
    if (paramFloat1 > this.mMaxZoom)
      paramFloat1 = this.mMaxZoom;
    while (true)
    {
      float f1 = paramFloat1 / getScale();
      Log.d("deltaScale", "deltaScale:" + f1);
      this.mSuppMatrix.postScale(f1, f1, paramFloat2, paramFloat3);
      this.videoViewStandard.setScaleType(ImageView.ScaleType.MATRIX);
      this.videoViewStandard.setImageMatrix(getImageViewMatrix());
      return;
      if (paramFloat1 < this.mMinZoom)
        paramFloat1 = this.mMinZoom;
    }
  }

  class MyBrodCast extends BroadcastReceiver
  {
    MyBrodCast()
    {
    }

    public void onReceive(Context paramContext, Intent paramIntent)
    {
      if (paramIntent.getIntExtra("ifdrop", 2) != 2)
        PlayActivity.this.PPPPMsgHandler.sendEmptyMessage(1004);
    }
  }

  private class surfaceCallback
    implements SurfaceHolder.Callback
  {
    private surfaceCallback()
    {
    }

    public void surfaceChanged(SurfaceHolder paramSurfaceHolder, int paramInt1, int paramInt2, int paramInt3)
    {
      if (paramSurfaceHolder == PlayActivity.this.playHolder)
      {
        PlayActivity.access$302(PlayActivity.this, 10);
        NativeCaller.StartPPPPLivestream(PlayActivity.this.strDID, PlayActivity.this.streamType);
      }
    }

    public void surfaceCreated(SurfaceHolder paramSurfaceHolder)
    {
    }

    public void surfaceDestroyed(SurfaceHolder paramSurfaceHolder)
    {
    }
  }
}

 Location:           D:\Program Files\Android\dex2jar-0.0.9.15\classes_dex2jar.jar
 * Qualified Name:     com.ipcamer.demo.PlayActivity
 * JD-Core Version:    0.6.2
 */